package com.itheima.tcpdemo01;

import java.io.IOException;
import java.io.OutputStream;
import java.net.Socket;

public class TcpSocket {

    public static void main(String[] args) throws IOException {
        //创建 TCP Socket
        Socket st = new Socket("127.0.0.1",10001);

        //创建输出流OutputStream
        OutputStream os = st.getOutputStream();

        //写入数据
        os.write("aaa".getBytes());

        //释放资源
        st.close();
    }

}
